package dockyin.creative.pattern.factory;

import dockyin.creative.pattern.vo.Sender;
import dockyin.creative.pattern.vo.impl.EmailSender;
import dockyin.creative.pattern.vo.impl.SmsSender;

public class SingleSenderFactory {
    public Sender produce(String type) {
        if (null == type) {
            System.out.println("No sender'll feedback cause empty type got.");
            return null;
        }

        switch (type) {
            case SmsSender.SENDER_TYPE:
                return new SmsSender();
            case EmailSender.SENDER_TYPE:
                return new EmailSender();
            default:
                System.out.println("No sender'll feedback cause unknown type got.");
        }

        return null;
    }
}
